package com.xhwl.logistics.converter.mapstruct;

import com.xhwl.common.dto.cent.vehicle.feign.VehicleAccessRecordRealtimeQuery;
import com.xhwl.logistics.bo.VehicleAccessRecordRealtimeBO;
import com.xhwl.logistics.bo.VehicleAccessRecordSecondBO;
import com.xhwl.logistics.bo.input.QueryVehicleAccessRecordRealtimeBO;
import com.xhwl.logistics.dto.http.AccessRecordNanTouDTO;
import com.xhwl.logistics.util.AboutDateUtil;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueMappingStrategy;

import java.util.Date;
import java.util.List;

@Mapper(componentModel = "spring", nullValueMappingStrategy = NullValueMappingStrategy.RETURN_DEFAULT)
public interface VehicleAccessRecordRealtimeConverter {

    QueryVehicleAccessRecordRealtimeBO vehicleAccessRecordRealtimeQuery2QueryVehicleAccessRecordRealtimeBO(VehicleAccessRecordRealtimeQuery vehicleAccessRecordRealtimeQuery);

    default VehicleAccessRecordRealtimeBO toVehicleAccessRecordRealtimeBO(List<VehicleAccessRecordSecondBO> vehicleAccessRecordSecondBOList) {
        return new VehicleAccessRecordRealtimeBO(vehicleAccessRecordSecondBOList);
    }

    List<VehicleAccessRecordSecondBO> accessRecordNanTouDTOList2VehicleAccessRecordSecondBOList(List<AccessRecordNanTouDTO> accessRecordNanTouDTOList);

    VehicleAccessRecordSecondBO accessRecordNanTouDTO2VehicleAccessRecordSecondBO(AccessRecordNanTouDTO accessRecordNanTouDTO);

    default String date2String(Date date) {
        return AboutDateUtil.dateToString(date);
    }

}
